using GLib;
using Rob;

namespace Rob
{
	namespace Actions
	{
		public class AnswerAsterisk: Rob.Actions.Action
		{
			private string _name;
			private string _title;
			private string _record_file;

			public string record_file
			{
				get{ return _record_file;}
				set{ _record_file = value; }

			}
			public bool load(string name, KeyFile kf)
			{
				try
				{
					_record_file = kf.get_string(name, "record_file");
					_name = name;
					_title = kf.get_string(name, "title");
				}
				catch( GLib.KeyFileError e)
				{
					GLib.critical("Can't save %s: %s\n", name, e.message );
					return false;
				}

				return true;
			}
			public bool save(ref KeyFile kf)
			{
				try
				{
					base.save( ref kf );
					kf.set_string(name,"record_file",_record_file);
					kf.set_string(name,"title", _title );
				}
				catch( GLib.KeyFileError e )
				{
					GLib.critical("Can't save %s: %s\n", name, e.message );
					return false;
				}
				return true;
			}
			construct 
			{
			}
			[ModuleInit]
			public Type register_rb_plugin (TypeModule module) 
			{
				stdout.printf ("Registering plugin %s\n", "RunCommand");
				return typeof (AnswerAsterisk);
			}
		}
		[ModuleInit]
		public GLib.Type get_type_of_answer_asterisk()
		{
			return typeof(Rob.Actions.AnswerAsterisk);
		}
	}
}
